/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rbh.risk.service.impl;

import com.rbh.risk.dao.CategoryDao;
import com.rbh.risk.entity.Category;
import com.rbh.risk.service.CategoryService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("categoryService")
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryDao categoryDao;

    @Transactional(readOnly = false)
    @Override
    public void insert(Category category) {
        this.categoryDao.insert(category);
    }

    @Transactional(readOnly = false)
    @Override
    public void update(Category category) {
        this.categoryDao.update(category);
    }

    @Transactional(readOnly = false)
    @Override
    public void delete(Category category) {
        this.categoryDao.delete(category);
    }

    @Transactional(readOnly = true)
    @Override
    public Category getById(Integer categoryId) {
        return this.categoryDao.getById(categoryId);
    }

    @Transactional(readOnly = true)
    @Override
    public List<Category> getAll() {
        return this.categoryDao.getAll();
    }
}
